<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>05v-on绑定事件</title>
<style>
  .box{
    width: 200px;
    height: 200px;
    background-color: #5f7;
  }
</style>
</head>
<body>

  <div id='app'>
    <!-- <button v-on:click="fn">{{isShow?"消失":"显示"}}</button> -->
    <button @click="fn">{{isShow?"消失":"显示"}}</button>
    <hr>
    <div class="box" v-show="isShow"></div>
  </div>

<script src='https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js'></script>
<script>
  const app = new Vue({
    el: '#app'
    ,data:{
      isShow: true
    }
    ,methods: {
      fn(){
        this.isShow = !this.isShow
      }
    }
  })
</script>
</body>
</html>